f = open("m1_sorted.txt")
m1 = f.read().split()
f = open("m2_reverse.txt")
m2 = f.read().split()
f = open("m3_shuffle.txt")
m3 = f.read().split()
import timeit
def bubble_sort(n):
    swapped = True
    while swapped:
        swapped = False
        for _ in range(len(n) - 1):
            if n[_] > n[_ + 1]:
                n[_], n[_ + 1] = n[_ + 1], n[_]
                swapped = True
st = timeit.default_timer()
bubble_sort(m1)
t1 = timeit.default_timer() - st
print('m1_sorted', int(t1 * 1000), 'milliseconds')
st = timeit.default_timer()
bubble_sort(m2)
t2 = timeit.default_timer() - st
print('m2_reverse', int(t2 * 1000), 'milliseconds')
st = timeit.default_timer()
bubble_sort(m3)
t3 = timeit.default_timer() - st
print('m3_shuffle', int(t3 * 1000), 'milliseconds')
